#ifndef _IMSERVER_COMMON_DEF_H_
#define _IMSERVER_COMMON_DEF_H_

#include <stdint.h>
#include <string>

namespace imserver {

extern const char * IM_QID_COOKIE;
extern const char * IM_QID_TICKET_COOKIE;

extern const char * IM_TEMP_ID_COOKIE;
extern const char * IM_TEMP_ID_TICKET_COOKIE;

extern const int64_t IM_TEMP_ID_BASE;

extern char * kDefaultHeadPic;

extern const int MSG_TYPE_TALK;
extern const int MSG_TYPE_LOGIN_NOTIFY;
extern const int MSG_TYPE_OFFLINE_NOTIFY;
extern const int MSG_TYPE_PRESENCE;
extern const int MSG_TYPE_TYPING;
extern const int MSG_TYPE_BANG_ORDER; // 同城帮订单通知

class ImMessage;

int MessageType(const ImMessage & message);
void SetMessageType(ImMessage & message, int type);

int GetSessionShardId(const std::string & session);

std::string GetUsername(int64_t uid);

std::string GetDefaultUsername(int64_t uid);

int DispatchDefaultMessage(ImMessage & message);

enum MSG_FLAGS {
  MSG_FLAG_READ = 0x01,
  MSG_FLAG_RECREATE_ON_LINGER = 0x02
};

}

#endif // _IMSERVER_COMMON_DEF_H_

